package com.learn.spring.event.service;

import org.springframework.scheduling.annotation.Async;
import org.springframework.stereotype.Service;

/**
 * 模拟异常
 *
 * @author: MI
 * @email: 448341911@qq.com
 * @createTime: 2025/1/27 21:36
 * @updateUser: MI
 * @updateTime: 2025/1/27 21:36
 * @updateRemark: 修改内容
 * @version: v1.0
 */
@Service
public class AsyncService {

    @Async("fighter3AsyncExecutor")
    public void asyncMethodWithException() {
        System.out.println("Async method is running on thread: " + Thread.currentThread().getName());
        // 模拟异常
        throw new RuntimeException("Test exception in async method");
    }
}


